$(
    function () {
        console.log("成功");
        
        axios.get("http://localhost:5000/book").then((res=>{
            let data=res.data
            console.log(data);
            
            let book=data.data
            console.log(book);
            
            book.forEach(
                item=>{
                    let html=`
                      <tr class=book${item.id}>
                <td>${item.id}</td>
                <td>${item.bookName}</td>
                <td>${item.bookPirce}</td>
                <td>${item.bookAuthor}</td>
                <td><input type="button" name="" value="编辑" onclick="updBtn(${item.id})"><input type="button" name="" value="删除" onclick="delBtn(${item.id})"></td>
            </tr>
    
       
                    `
                    $(`tbody`).append(html)
                    console.log(html);
                    
                }
            )
        }))
    }
)
function updBtn(id) {
   console.log("111");
   location.href=`./addOrUpd.html?id=${id}`
    
}